// pages/bookingDetails/bookingDetails.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    bnrUrl: [{
      "url": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1572261245855&di=c553d74a210e0f34fadb95a3a96c6533&imgtype=0&src=http%3A%2F%2Fpic2.zhimg.com%2Fv2-30a0833e8008be9cd7643a89e17809b7_1200x500.jpg"
    }, {
      "url": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1572261246580&di=54526b9bae86050386910525e346d13b&imgtype=0&src=http%3A%2F%2Fimage.winmobi.cn%2Fkindeditor%2Fattached%2Fimage%2F20171026%2F20171026110509_3305.png"
    }, {
      "url": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1572261246579&di=2110e37585432d303c9cf1628f55feed&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F0100e35b0e53f7a8012043d870036d.jpg%402o.jpg"
    }, {
      "url": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1572261246579&di=a1642de498eb1c373927d1c37f59bf9b&imgtype=0&src=http%3A%2F%2Ftu.ossfiles.cn%3A9186%2Fgroup1%2FM00%2F5E%2F5E%2FrBgIBlz_GJmTUvnfAADGUYKZtmM148.jpg"
    }],
    text: '\n',
  },
  //微信联系我们
  //电话联系
  telephoneContact: function (res) {
    wx.makePhoneCall({
      success: function (res) {
        phoneNumber: '15760163770'
      },
      fail: function (res) {
        wx.showModal({
          title: '',
          content: '失败',
          showCancel: false
        })
      }
    })
  },

  //立即预约
  makeAppointment: function (makeAppointmentMessage){
    wx.navigateTo({
      url: '',
      evens:{
        // 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
        acceptDataFromOpenedPage: function (data) {
        console.log(data)
        }
      },
      success:function(){},
      fail:function(){}
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that=this;
    wx.request({
      url: '',
      method:'',
      header:{
        'content-type': 'application/json'
      },
      success:function(){},
      fail:function(){
        wx.showModal({
          content: '网络开了小差，是否刷新？',
          success(res) {
            if (res.confirm) {
              //页面刷新
              const pages = getCurrentPages()
              const perpage = pages[pages.length - 1]
              perpage.onLoad()
            } else if (res.cancel) {

            }
          }
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})